<%--
  Created by IntelliJ IDEA.
  User: liuchang
  Date: 2021/8/20
  Time: 16:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户注册</title>
    <script src="js/jquery-1.11.1.js"></script>
    <script src="js/bootstrap.js"></script>
    <link rel="stylesheet" href="css/bootstrap.css" />
    <link rel="stylesheet" href="css/bootstrap-theme.css" />
    <script>
        $(function () {
            $("[name='username']").blur(function () {
                //获取username值
                var uname = $(this).val();
                //发送请求
                $.ajax({
                    url:"/sign",
                    data:"uname="+uname,
                    type:"post",
                    dataType:"text",
                    success:function (rs) {
                        $("#isRepete").html(rs);
                    }
                })
            })
        })
    </script>
</head>
<body>
    <div class="signFormArea">
        <form role="form" class="form-horizontal" method="post" action="sign">
            <div class="form-group">
                <label for="usrname" class="col-md-3 col-lg-offset-2 control-label">用户名</label>
                <div class="col-md-2">
                    <input type="text" class="form-control" name="username" placeholder="请输入用户名" required="required"/>
                </div>
                <div class="col-md-2">
                    <span id="isRepete" style="color: red"></span>
                </div>
            </div>
            <div class="form-group">
                <label for="password" class="col-md-3 col-lg-offset-2 control-label">密码</label>
                <div class="col-md-2">
                    <input type="text" class="form-control" name="password" placeholder="请输入密码" required="required"/>
                </div>
            </div>
            <div class="form-group">
                <label for="sex" class="col-md-3 col-lg-offset-2 control-label">选择性别</label>
                <div class="col-md-4">
                    <div class="radio">
                        <label>
                            <input type="radio"  name="sex" value="男" checked="checked"/>男
                        </label>
                    </div>
                    <div class="radio">
                        <label>
                            <input type="radio" name="sex" value="女"/>女
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label for="tel" class="col-md-3 col-lg-offset-2 control-label">电话</label>
                <div class="col-md-2">
                    <input type="tel" class="form-control" name="tel" placeholder="请输入电话" required="required"/>
                </div>
            </div>
            <div class="form-group">
                <label for="submitBtn" class="col-md-3 col-lg-offset-2 control-label"></label>
                <div class="col-md-2">
                    <input type="submit" class="btn btn-primary form-control" value="注册">
                </div>
            </div>
        </form>
    </div>
</body>
</html>
